package com.lemon.smartsafety.data.app;

import android.util.Log;

import com.lemon.smartsafety.BuildConfig;
import com.lemon.smartsafety.R;
import com.lemon.smartsafety.app.ApplicationInfo;
import com.lemon.smartsafety.app.Constants;
import com.lemon.smartsafety.app.IApplication;
import com.lemon.smartsafety.entity.hidden.HiddenMainUIVo;
import com.lemon.smartsafety.entity.hidden.MainHiddenUIItemBase;
import com.lemon.smartsafety.entity.main.MainPanelButton;
import com.lemon.smartsafety.entity.menu.DrawItem;
import com.lemon.smartsafety.entity.user.ProfileCommonModel;
import com.lemon.smartsafety.ui.activity.hidden.HiddenMainActivity;
import com.lemon.smartsafety.ui.adapter.common.RcvViewType;
import com.lemon.smartsafety.ui.adapter.hidden.main.HiddenMainAdapter;
import com.lemon.smartsafety.ui.adapter.profile.ProfileTag;
import com.lemon.smartsafety.ui.adapter.profile.ProfileViewType;
import com.lemon.smartsafety.ui.fragment.MainFragment;
import com.lemon.smartsafetynew.entity.User;
import com.lemon.smartsafetynew.entity.common.CommonBo;
import com.lemon.smartsafetynew.entity.ledger.LedgerPanelButton;
import com.lemon.smartsafetynew.entity.me.MePanelLabel;
import com.lemon.smartsafetynew.entity.record.FunctionVo;
import com.lemon.smartsafetynew.ui.fragment.contact.ContactFragment;
import com.lemon.smartsafetynew.ui.fragment.me.MeFragment;
import com.lemon.smartsafetynew.ui.fragment.notice.NoticeFragment;
import com.lemon.smartsafetynew.ui.fragment.notice.NoticeOldFragment;
import com.lemon.smartsafetynew.ui.fragment.work.WorkFragment;
import com.lemon.smartsafetynew.util.common.AppSharePreferenceUtil;
import com.lemon.smartsafetynew.util.constants.SafeCloudConstants;
import com.lemon.smartsafetynew.util.user.AccountUtil;
import com.lemon.smartsafetynew.util.user.UserTypeUtil;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Cooliean on 16/1/18.
 */
public class DataUtil {
    //    public static int[][] mainGridData = {
    //            {R.string.app_option_1, R.mipmap.menu_icon_self, R.color.colorAppOption1},
    //            {R.string.app_option_2, R.mipmap.menu_icon_check, R.color.colorAppOption2},
    //            {R.string.app_option_3, R.mipmap.menu_icon_news, R.color.colorAppOption3},
    //            {R.string.app_option_4, R.mipmap.menu_icon_address, R.color.colorPrimaryDark},
    //            {R.string.app_option_5, R.mipmap.menu_icon_shop, R.color.colorAppOption5},
    //            {R.string.app_option_6, R.mipmap.menu_icon_login, R.color.colorAppOption6}
    //    };

    public static MainPanelButton getMainButtonByResString(List<MainPanelButton> items, int res) {
        MainPanelButton resultButton = null;
        for (int i = 0; i < items.size(); i++) {
            MainPanelButton button = items.get(i);
            if (button.getTitleRes() == res) {
                resultButton = button;
                break;
            }
        }
        return resultButton;
    }

    public static List<MainPanelButton> getMainUIButtons() {
/*        MainPanelButton btn1 = new MainPanelButton(R.string.app_option_1, R.mipmap.menu_icon_self, R.color.colorAppOption1, HiddenMainActivity.class
                .getName(), ApplicationInfo.ApplicationCode.HIDDEN_DANGER);
        MainPanelButton btn2 = new MainPanelButton(R.string.app_option_2, R.mipmap.menu_icon_check, R.color.colorAppOption2, HiddenMainActivity.class
                .getName(), ApplicationInfo.ApplicationCode.FIRE_SAFE);
        MainPanelButton btn3 = new MainPanelButton(R.string.app_option_3, R.mipmap.menu_icon_news, R.color.colorAppOption3, HiddenMainActivity.class
                .getName(), ApplicationInfo.ApplicationCode.ANJIAN_NOTICE);
        MainPanelButton btn4 = new MainPanelButton(R.string.app_option_4, R.mipmap.menu_icon_address, R.color.colorPrimaryDark, HiddenMainActivity.class
                .getName(), ApplicationInfo.ApplicationCode.FIRE_ADDRESS);
        MainPanelButton btn5 = new MainPanelButton(R.string.app_option_5, R.mipmap.menu_icon_shop, R.color.colorAppOption5, HiddenMainActivity.class
                .getName(), ApplicationInfo.ApplicationCode.JIFEN_SHOP);
        MainPanelButton btn6 = new MainPanelButton(R.string.app_option_6, R.mipmap.menu_icon_login, R.color.colorAppOption6, ApplicationInfo.ApplicationCode.USER_PROFILE);
        MainPanelButton btn7 = new MainPanelButton(R.string.app_option_7, R.mipmap.menu_icon_fire_wulianwang, R.color.colorAppOption7, ApplicationInfo.ApplicationCode.FIRE_SUPERVISON);
        MainPanelButton btn8 = new MainPanelButton(R.string.app_option_8, R.mipmap.menu_icon_edit, R.color.colorAppOption8, ApplicationInfo.ApplicationCode.NINE_SMALL);*/


        MainPanelButton btn1 = new MainPanelButton(R.string.app_option_1, R.mipmap.menu_icon_self_new, -1, HiddenMainActivity.class
                .getName(), -1, ApplicationInfo.ApplicationCode.HIDDEN_DANGER);
        MainPanelButton btn2 = new MainPanelButton(R.string.app_option_2, R.mipmap.menu_icon_check_new, -1, HiddenMainActivity.class
                .getName(), -1, ApplicationInfo.ApplicationCode.FIRE_SAFE);
        MainPanelButton btn3 = new MainPanelButton(R.string.app_option_3, R.mipmap.menu_icon_news_new, -1, HiddenMainActivity.class
                .getName(), -1, ApplicationInfo.ApplicationCode.ANJIAN_NOTICE);
        MainPanelButton btn5 = new MainPanelButton(R.string.app_option_5, R.mipmap.menu_icon_shop_new, -1, HiddenMainActivity.class
                .getName(), -1, ApplicationInfo.ApplicationCode.JIFEN_SHOP);
        MainPanelButton btn6 = new MainPanelButton(R.string.app_option_6, R.mipmap.menu_icon_login_new, -1,
                -1, ApplicationInfo.ApplicationCode.USER_PROFILE);
        MainPanelButton btn4 = new MainPanelButton(R.string.app_option_4, R.mipmap.menu_icon_address_new, -1, HiddenMainActivity.class
                .getName(), -1, ApplicationInfo.ApplicationCode.FIRE_ADDRESS);



       /* MainPanelButton btn1 = new MainPanelButton(R.string.app_option_1, R.mipmap.menu_icon_self, R.color.colorAppOption1, HiddenMainActivity.class
                .getName(),R.drawable.base_click_circle_blue, ApplicationInfo.ApplicationCode.HIDDEN_DANGER);
        MainPanelButton btn2 = new MainPanelButton(R.string.app_option_2, R.mipmap.menu_icon_check, R.color.colorAppOption2, HiddenMainActivity.class
                .getName(), R.drawable.base_click_circle_green,ApplicationInfo.ApplicationCode.FIRE_SAFE);
        MainPanelButton btn3 = new MainPanelButton(R.string.app_option_3, R.mipmap.menu_icon_news, R.color.colorAppOption3, HiddenMainActivity.class
                .getName(),R.drawable.base_click_circle_purple, ApplicationInfo.ApplicationCode.ANJIAN_NOTICE);
        MainPanelButton btn5 = new MainPanelButton(R.string.app_option_5, R.mipmap.menu_icon_shop, R.color.colorAppOption5, HiddenMainActivity.class
                .getName(),R.drawable.base_click_circle_pink, ApplicationInfo.ApplicationCode.JIFEN_SHOP);
        MainPanelButton btn6 = new MainPanelButton(R.string.app_option_6, R.mipmap.menu_icon_login, R.color.colorAppOption6,
                R.drawable.base_click_circle_yellow, ApplicationInfo.ApplicationCode.USER_PROFILE);
        MainPanelButton btn4 = new MainPanelButton(R.string.app_option_4, R.mipmap.menu_icon_address, R.color.colorPrimaryDark, HiddenMainActivity.class
                .getName(), R.drawable.base_click_circle_blue_deep,ApplicationInfo.ApplicationCode.FIRE_ADDRESS);
        MainPanelButton btn7 = new MainPanelButton(R.string.app_option_7, R.mipmap.menu_icon_fire_wulianwang, R.color.colorAppOption7,R.drawable.base_click_circle_orange, ApplicationInfo.ApplicationCode.FIRE_SUPERVISON);
        MainPanelButton btn8 = new MainPanelButton(R.string.app_option_8, R.mipmap.menu_icon_edit, R.color.colorAppOption8,R.drawable.base_click_circle_blue_light, ApplicationInfo.ApplicationCode.NINE_SMALL);*/


        List<MainPanelButton> items = new ArrayList<MainPanelButton>();
        items.add(btn1);
        items.add(btn2);
        items.add(btn3);
        items.add(btn4);
        items.add(btn5);
        items.add(btn6);
  /*      items.add(btn7);
        items.add(btn8);*/

        MainPanelButton btn9 = new MainPanelButton(R.string.empty, R.mipmap.one_point, R.color.transparent);
        MainPanelButton btn10 = new MainPanelButton(R.string.empty, R.mipmap.one_point, R.color.transparent);
        items.add(btn9);
        items.add(btn10);

        return items;
    }

    /**
     * 工作页面，主要操作
     * add by Andrew.yin 2017/7/3 begin.
     */
    public static List<MainPanelButton> getWorkMainUIButtons() {

        //this.titleRes = titleRes;
        //this.iconRes = iconRes;
        //this.colorRes = colorRes;
        //this.className = className; //这个暂时没有用   HiddenMainActivity.class.getName()  <-- 没用
        //this.bgRes = bgRes;
        //this.workOptionCode = applicationCode;

        MainPanelButton btnCompanyInfo = new MainPanelButton(R.string.work_options_main_1,
                R.mipmap.menu_icon_company_info,
                -1,
                HiddenMainActivity.class.getName(),
                -1,
                ApplicationInfo.WorkOptionCodeEnum.COMPANY_INFO);


        MainPanelButton btnHidden = new MainPanelButton(R.string.work_options_main_2,
                R.mipmap.menu_icon_safe_hidden_danger,
                -1,
                HiddenMainActivity.class.getName(),
                -1,
                ApplicationInfo.WorkOptionCodeEnum.SAFE_HIDDEN_DANGER);

        MainPanelButton btnLedger = new MainPanelButton(R.string.work_options_main_3,
                R.mipmap.menu_icon_safe_ledger,
                -1,
                HiddenMainActivity.class.getName(),
                -1,
                ApplicationInfo.WorkOptionCodeEnum.SAFE_LEDGER);

        MainPanelButton btnMonitor = new MainPanelButton(R.string.work_options_main_4,
                R.mipmap.menu_icon_monitor,
                -1,
                HiddenMainActivity.class.getName(),
                -1,
                ApplicationInfo.WorkOptionCodeEnum.MONITOR);

        MainPanelButton btnDevice = new MainPanelButton(R.string.work_options_main_5,
                R.mipmap.menu_icon_device_manage,
                -1,
                HiddenMainActivity.class.getName(),
                -1,
                ApplicationInfo.WorkOptionCodeEnum.DEVICE_MANAGE);

        MainPanelButton btnIncident = new MainPanelButton(R.string.work_options_main_6,
                R.mipmap.menu_icon_incident_manage,
                -1,
                HiddenMainActivity.class.getName(),
                -1,
                ApplicationInfo.WorkOptionCodeEnum.EVENT_PROCESS);

        MainPanelButton btnSnapshot = new MainPanelButton(R.string.work_options_main_7,
                R.mipmap.menu_icon_snapshot,
                -1,
                HiddenMainActivity.class.getName(),
                -1,
                ApplicationInfo.WorkOptionCodeEnum.SNAPSHOT);

        MainPanelButton btnElectrcialSafety = new MainPanelButton(R.string.work_options_main_8,
                R.mipmap.menu_icon_electrical_safety,
                -1,
                HiddenMainActivity.class.getName(),
                -1,
                ApplicationInfo.WorkOptionCodeEnum.ELECTRICAL_SAFETY);

        MainPanelButton btnVideoMonitor = new MainPanelButton(R.string.work_options_main_9,
                R.mipmap.menu_icon_video,
                -1,
                HiddenMainActivity.class.getName(),
                -1,
                ApplicationInfo.WorkOptionCodeEnum.VIDEO_MONITOR);

        MainPanelButton btnOnlineClass = new MainPanelButton(R.string.work_options_main_10,
                R.mipmap.icon_menu_online_classroom,
                -1,
                HiddenMainActivity.class.getName(),
                -1,
                ApplicationInfo.WorkOptionCodeEnum.ONLINE_CLASAROOM);

        MainPanelButton btnPatrolPath = new MainPanelButton(R.string.work_options_main_11,
                R.mipmap.menu_icon_patrol_path,
                -1,
                HiddenMainActivity.class.getName(),
                -1,
                ApplicationInfo.WorkOptionCodeEnum.PATROL_PATH);

        //图片需要更换
        MainPanelButton btnInspectionTask = new MainPanelButton(R.string.work_options_main_12,
                R.mipmap.menu_icon_patrol_path,
                -1,
                HiddenMainActivity.class.getName(),
                -1,
                ApplicationInfo.WorkOptionCodeEnum.INSPECTION_TASK);

        List<MainPanelButton> items = new ArrayList<MainPanelButton>();

        items.add(btnCompanyInfo);    //一企一档
        /*
        if (!UserTypeUtil.isGovType(AccountUtil.getUserType())) { //非政府人员使用模块
            items.add(btnPatrolPath); //任务路线
        }
        */
        items.add(btnHidden);         //隐患列表
        if (!UserTypeUtil.isGovType(AccountUtil.getUserType())) { //非政府人员使用模块
            items.add(btnLedger);     //企业台账
        }
        if (UserTypeUtil.isGovType(AccountUtil.getUserType())) { //政府人员使用模块
            items.add(btnSnapshot);   //随手拍
        }
        items.add(btnMonitor);        //实时监测
        items.add(btnOnlineClass);    //在线课堂

        if (!UserTypeUtil.isGovType(AccountUtil.getUserType())) { //非政府人员使用模块
            items.add(btnInspectionTask); //巡查任务
        }
        return items;
    }

    /**
     * 工作页面，次要操作
     * add by Andrew.yin 2017/7/3 begin.
     */
    public static List<MainPanelButton> getWorkSecondaryUIButtons() {

        //this.titleRes = titleRes;
        //this.iconRes = iconRes;
        //this.colorRes = colorRes;
        //this.className = className;   //这个暂时没有用
        //this.bgRes = bgRes;
        //this.workOptionCode = applicationCode;

        MainPanelButton btn1 = new MainPanelButton(R.string.work_options_secondary_1,
                R.mipmap.icon_laws_regulations,
                -1,
                HiddenMainActivity.class.getName(),
                -1,
                ApplicationInfo.WorkOptionCodeEnum.LAWS_REGULATIONS);

        MainPanelButton btn2 = new MainPanelButton(R.string.work_options_secondary_2,
                R.mipmap.icon_case_share,
                -1,
                HiddenMainActivity.class.getName(),
                -1,
                ApplicationInfo.WorkOptionCodeEnum.CASE_SHARE);

        MainPanelButton btn3 = new MainPanelButton(R.string.work_options_secondary_3,
                R.mipmap.icon_knowledge_base,
                -1,
                HiddenMainActivity.class.getName(),
                -1,
                ApplicationInfo.WorkOptionCodeEnum.KNOWLEDGE_BASE);

        MainPanelButton btn4 = new MainPanelButton(R.string.work_options_secondary_4,
                R.mipmap.icon_online_classroom,
                -1,
                HiddenMainActivity.class.getName(),
                -1,
                ApplicationInfo.WorkOptionCodeEnum.ONLINE_CLASS);

        MainPanelButton btn5 = new MainPanelButton(R.string.work_options_secondary_5,
                R.mipmap.icon_app_use_help,
                -1,
                HiddenMainActivity.class.getName(),
                -1,
                ApplicationInfo.WorkOptionCodeEnum.USER_HELP);


        List<MainPanelButton> items = new ArrayList<MainPanelButton>();
        //items.add(btn1);
        //items.add(btn2);
        //items.add(btn3);
        //items.add(btn4);
        items.add(btn5);

        return items;

    }


    //add by Andrew.yin 2017/7/3 end.



    /*
    <string name="draw_home">首页</string>
    <string name="draw_news">新闻公告</string>
    <string name="draw_app">我的应用</string>
    <string name="draw_score">我的积分</string>
    <string name="draw_area">我的属地</string>
    <string name="draw_role">我的角色</string>
    <string name="draw_password">密码修改</string>
    <string name="draw_mail">绑定邮箱</string>
    <string name="draw_setting">更多设置</string>
    */

    public static List<DrawItem> getDrawMenuItems() {

        List<DrawItem> items = new ArrayList<>();

        //change by Andrew.yin 2017/7/3 begin
//        DrawItem itemHome = new DrawItem(R.string.draw_home, R.drawable.draw_icon_home_drawer, MainFragment.class.getName());
//        items.add(itemHome);
//
//        DrawItem itemNews = new DrawItem(R.string.draw_news, R.drawable.draw_icon_news_drawer, NewsFragment.class.getName());
//        items.add(itemNews);
//
//        DrawItem itemApp = new DrawItem(R.string.draw_app, R.drawable.draw_icon_app_drawer, MyAppFragment.class.getName());
//        items.add(itemApp);
//
//
//        //        DrawItem itemScore = new DrawItem(R.string.draw_score, R.drawable.draw_icon_score_drawer, MainFragment.class.getName());
//        //        items.add(itemScore);
//        //
//        //        DrawItem itemRole = new DrawItem(R.string.draw_role, R.drawable.draw_icon_role_drawer, MainFragment.class.getName());
//        //        items.add(itemRole);
//        //
//        //        DrawItem itemPassword = new DrawItem(R.string.draw_password, R.drawable.draw_icon_password_drawer, MainFragment.class.getName());
//        //        items.add(itemPassword);
//        //
//        //        DrawItem itemMail = new DrawItem(R.string.draw_mail, R.drawable.draw_icon_mail_drawer, MainFragment.class.getName());
//        //        items.add(itemMail);
//
//        DrawItem itemSetting = new DrawItem(R.string.draw_setting, R.drawable.draw_icon_setting_drawer, UserProfileFragment.class
//                .getName());
//        items.add(itemSetting);

        // ======== 新的主页面，新的导航逻辑 2017/7/3 =========
        DrawItem itemHome = new DrawItem(R.string.draw_home, R.drawable.draw_icon_home_drawer, MainFragment.class.getName());
        items.add(itemHome);

        DrawItem itemWork = new DrawItem(R.string.draw_work, R.drawable.draw_icon_news_drawer, WorkFragment.class.getName());
        items.add(itemWork);

        //DrawItem itemNotice = new DrawItem(R.string.draw_notice, R.drawable.draw_icon_app_drawer, NoticeFragment.class.getName());
        DrawItem itemNotice = new DrawItem(R.string.draw_notice, R.drawable.draw_icon_app_drawer, NoticeOldFragment.class.getName());
        items.add(itemNotice);

        DrawItem itemContact = new DrawItem(R.string.draw_contact, R.drawable.draw_icon_setting_drawer, ContactFragment.class.getName());
        items.add(itemContact);

        DrawItem itemMe = new DrawItem(R.string.draw_me, R.drawable.draw_icon_setting_drawer, MeFragment.class.getName());
        items.add(itemMe);
        //change by Andrew.yin 2017/7/3 end

        return items;
    }


    /**
     * MainActivity的FragmentList
     *
     * @return
     */
    public static Map<Integer, String> getListForMainActivity() {
        Map<Integer, String> result = new HashMap<>();
        for (DrawItem item : DataUtil.getDrawMenuItems()) {
            result.put(item.getTitle(), item.getClassName());
        }
        return result;
    }


    /**
     * 我的中的列表数据
     *
     * @return
     */
    public static List<ProfileCommonModel> getProfileItems(boolean isLogin) {
        List<ProfileCommonModel> result = new ArrayList<>();

        ProfileCommonModel common1 = new ProfileCommonModel();
        common1.setFirst(true);
        common1.setViewType(ProfileViewType.TYPE_COMMON_ITEM);
        common1.setTitle(R.string.profile_area);
        common1.setShowArrow(false);
        common1.setTag(ProfileTag.TAG_AREA);
        common1.setIcon(R.mipmap.ic_explore);


        ProfileCommonModel common2 = new ProfileCommonModel();
        common2.setViewType(ProfileViewType.TYPE_COMMON_ITEM);
        common2.setTag(ProfileTag.TAG_EMAIL);
        common2.setIcon(R.mipmap.ic_item_email);
        common2.setTitle(R.string.profile_email);


        ProfileCommonModel common3 = new ProfileCommonModel();
        common3.setViewType(ProfileViewType.TYPE_COMMON_ITEM);
        common3.setTag(ProfileTag.TAG_PASSWORD);
        common3.setIcon(R.mipmap.ic_item_password);
        common3.setTitle(R.string.profile_password);


        ProfileCommonModel head = new ProfileCommonModel();
        head.setViewType(ProfileViewType.TYPE_SECTION_HEAD);


//        ProfileCommonModel common41 = new ProfileCommonModel();
//        common41.setFirst(true);
//        common41.setViewType(ProfileViewType.TYPE_SWITCH);
//        common41.setTag(ProfileTag.TAG_FIRE_BACK_SETTING);
//        common41.setIcon(R.mipmap.ic_explore);
//        common41.setTitle(R.string.profile_fire_back_setting);
//        common41.setValue("低配手机建议打开");


        ProfileCommonModel common4 = new ProfileCommonModel();
        common4.setFirst(true);
        common4.setViewType(ProfileViewType.TYPE_COMMON_ITEM);
        common4.setTag(ProfileTag.TAG_SETTING);
        common4.setIcon(R.mipmap.ic_item_profile_setting);
        common4.setTitle(R.string.profile_setting);


        ProfileCommonModel common5 = new ProfileCommonModel();
        common5.setViewType(ProfileViewType.TYPE_COMMON_ITEM);
        common5.setTag(ProfileTag.TAG_UPDATE);
        common5.setIcon(R.mipmap.ic_item_update);
        common5.setTitle(R.string.profile_update);


    /*    ProfileCommonModel common6 = new ProfileCommonModel();
        common6.setFirst(true);
        common6.setViewType(ProfileViewType.TYPE_COMMON_ITEM);
        common6.setTag(ProfileTag.TAG_FIRE_SETTING);
        common6.setIcon(R.mipmap.draw_icon_setting_selected);
        common6.setTitle(R.string.profile_fire_setting);
*/

        ProfileCommonModel head2 = new ProfileCommonModel();
        head2.setViewType(ProfileViewType.TYPE_SECTION_HEAD);

        if (isLogin) {
            result.add(common1);
            result.add(common2);
            result.add(common3);
        }

        result.add(head);
        //result.add(common41);

        if (IApplication.ISTEST()) {
            result.add(common4);
            //result.add(common6);
        }
        result.add(common5);


        /*这里加了一个空白头 */
        result.add(head2);


        ProfileCommonModel commonExist = new ProfileCommonModel();
        commonExist.setFirst(true);
        commonExist.setViewType(ProfileViewType.TYPE_EXIST);
        commonExist.setShowArrow(false);
        commonExist.setTag(ProfileTag.TAG_EXIST);

        if (isLogin) {
            result.add(commonExist);
        }


        return result;
    }

    public static ProfileCommonModel getProfileCommonItemByTag(List<ProfileCommonModel> result, ProfileTag tag) {
        ProfileCommonModel model = null;
        for (int i = 0; i < result.size(); i++) {
            ProfileCommonModel temp = result.get(i);
            if (temp.getTag() == tag) {
                model = temp;
                break;
            }
        }
        return model;
    }


    public static List<MainHiddenUIItemBase<HiddenMainUIVo>> getHiddenMainUiDatas(boolean hasZero) {

        List<MainHiddenUIItemBase<HiddenMainUIVo>> results = new ArrayList<>();
        MainHiddenUIItemBase<HiddenMainUIVo> head1 = new MainHiddenUIItemBase<>();
        head1.setViewType(RcvViewType.CommonRcvViewType.TYPE_SECTION_HEAD);
        results.add(head1);


        MainHiddenUIItemBase<HiddenMainUIVo> voCycleItem = new MainHiddenUIItemBase<>();
        voCycleItem.setViewType(RcvViewType.CommonRcvViewType.TYPE_COMMON_ITEM);
        HiddenMainUIVo voCycle = new HiddenMainUIVo();
        voCycle.setTitle(R.string.hidden_cycle);
        voCycleItem.setTag(HiddenMainAdapter.HiddenMainUITag.TAG_CYCLE);
        voCycleItem.setData(voCycle);
        results.add(voCycleItem);


        MainHiddenUIItemBase<HiddenMainUIVo> voReprotItem = new MainHiddenUIItemBase<>();
        voReprotItem.setViewType(RcvViewType.CommonRcvViewType.TYPE_COMMON_ITEM);
        HiddenMainUIVo voReprot = new HiddenMainUIVo();
        voReprot.setTitle(R.string.hidden_report);
        voReprotItem.setData(voReprot);
        voReprotItem.setTag(HiddenMainAdapter.HiddenMainUITag.TAG_REPORT_COUNT);
        results.add(voReprotItem);

        MainHiddenUIItemBase<HiddenMainUIVo> head2 = new MainHiddenUIItemBase<>();
        head2.setViewType(RcvViewType.CommonRcvViewType.TYPE_SECTION_HEAD);
        results.add(head2);


        //        if (hasZero) {
        //            MainHiddenUIItemBase<HiddenMainUIVo> voZeroItem = new MainHiddenUIItemBase<>();
        //            voZeroItem.setViewType(RcvViewType.CommonRcvViewType.TYPE_COMMON_ITEM);
        //            HiddenMainUIVo voZero = new HiddenMainUIVo();
        //            voZero.setTitle(R.string.hidden_zero_report);
        //            voZeroItem.setData(voZero);
        //            voZeroItem.setTag(HiddenMainAdapter.HiddenMainUITag.TAG_ZERO);
        //            results.add(voZeroItem);
        //        }

        MainHiddenUIItemBase<HiddenMainUIVo> voUploadReportItem = new MainHiddenUIItemBase<>();
        voUploadReportItem.setViewType(RcvViewType.CommonRcvViewType.TYPE_COMMON_ITEM);
        HiddenMainUIVo voUploadReport = new HiddenMainUIVo();
        voUploadReport.setTitle(R.string.hidden_upload_report);
        voUploadReportItem.setData(voUploadReport);
        voUploadReportItem.setTag(HiddenMainAdapter.HiddenMainUITag.TAG_UPLOAD_REPORT);
        results.add(voUploadReportItem);

        MainHiddenUIItemBase<HiddenMainUIVo> voModifyHiddenItem = new MainHiddenUIItemBase<>();
        voModifyHiddenItem.setViewType(RcvViewType.CommonRcvViewType.TYPE_COMMON_ITEM);
        HiddenMainUIVo voModifyHidden = new HiddenMainUIVo();
        voModifyHidden.setTitle(R.string.hidden_modify_hidden);
        voModifyHiddenItem.setData(voModifyHidden);
        voModifyHiddenItem.setTag(HiddenMainAdapter.HiddenMainUITag.TAG_MODIFY_HIDDEN);
        results.add(voModifyHiddenItem);


        return results;
    }


    public static MainHiddenUIItemBase<HiddenMainUIVo> getHiddenMainUIItemByTag(List<MainHiddenUIItemBase<HiddenMainUIVo>> result, HiddenMainAdapter.HiddenMainUITag tag) {
        MainHiddenUIItemBase<HiddenMainUIVo> model = null;
        for (int i = 0; i < result.size(); i++) {
            MainHiddenUIItemBase<HiddenMainUIVo> temp = result.get(i);
            if (temp.getTag() == tag) {
                model = temp;
                break;
            }
        }
        return model;
    }

    //add by Andrew.yin 2017/7/4 begin. "我的"页面，主要选项

    public static List<MePanelLabel> getMePanelGroupOne() {

        MePanelLabel label1 = new MePanelLabel();
        label1.setTitleRes(R.string.me_options_group_1_1);
        label1.setIconRes(R.mipmap.icon_password);
        label1.setMeOptionCode(ApplicationInfo.MeOptionCodeEnum.CHANGE_PASSWORD);

        MePanelLabel label2 = new MePanelLabel();
        label2.setTitleRes(R.string.me_options_group_1_2);
        label2.setIconRes(R.mipmap.icon_user_name);
        label2.setMeOptionCode(ApplicationInfo.MeOptionCodeEnum.CHANGE_USER_NAME);

        MePanelLabel label3 = new MePanelLabel();
        label3.setTitleRes(R.string.me_options_group_1_3);
        label3.setIconRes(R.mipmap.icon_user_exchange);
        label3.setMeOptionCode(ApplicationInfo.MeOptionCodeEnum.CHANGE_USER);

        List<MePanelLabel> items = new ArrayList<>();

        boolean multiUser = AppSharePreferenceUtil.getInstance().getBoolean(SafeCloudConstants.MULTI_USER, false);
        if (multiUser) {
            items.add(label3);
        }

        items.add(label1);
        //items.add(label2);

        return items;

    }

    public static List<MePanelLabel> getMePanelGroupTwo() {

        MePanelLabel label1 = new MePanelLabel();
        label1.setTitleRes(R.string.me_options_group_2_1);
        label1.setIconRes(R.mipmap.icon_server_setting);
        label1.setMeOptionCode(ApplicationInfo.MeOptionCodeEnum.SEVER_SETTING);

        MePanelLabel label2 = new MePanelLabel();
        label2.setTitleRes(R.string.me_options_group_2_2);
        label2.setIconRes(R.mipmap.icon_app_update);
        label2.setMeOptionCode(ApplicationInfo.MeOptionCodeEnum.APP_UPDATE);

        MePanelLabel label3 = new MePanelLabel();
        label3.setTitleRes(R.string.me_options_group_2_3);
        label3.setIconRes(R.mipmap.icon_building_manager);
        label3.setMeOptionCode(ApplicationInfo.MeOptionCodeEnum.CHECK_ITEM_BINDING);

        MePanelLabel label4 = new MePanelLabel();
        label4.setTitleRes(R.string.me_options_group_2_4);
        label4.setIconRes(R.mipmap.icon_about);
        label4.setMeOptionCode(ApplicationInfo.MeOptionCodeEnum.APP_ABOUT);

        List<MePanelLabel> items = new ArrayList<>();

        if(BuildConfig.FUNCTION_DEBUG) {
            items.add(label1);  //正式版要删除
        }

        items.add(label2);

        User user = AccountUtil.getUser();
        if (user != null) {
            if (ApplicationInfo.PRODUCT_SUPPORT.equals(user.getUserType())) { // FAE
                items.add(label3);
            }
        }

        items.add(label4);

        return items;

    }
    //add by Andrew.yin 2017/7/4 end.


    //add by Andew.yin 2017/8/14 begin
    public static List<LedgerPanelButton> getLedgerPanel() {

        LedgerPanelButton label1 = new LedgerPanelButton();
        label1.setTitleRes(R.string.ledger_item_1);
        label1.setIconRes(R.mipmap.icon_ledger_common_info);
        label1.setLedgerOptionCodeEnum(ApplicationInfo.LedgerOptionCodeEnum.COMMON_INFO);

        LedgerPanelButton label2 = new LedgerPanelButton();
        label2.setTitleRes(R.string.ledger_item_2);
        label2.setIconRes(R.mipmap.icon_ledger_building_info);
        label2.setLedgerOptionCodeEnum(ApplicationInfo.LedgerOptionCodeEnum.BUILDING_INFO);

        LedgerPanelButton label3 = new LedgerPanelButton();
        label3.setTitleRes(R.string.ledger_item_3);
        label3.setIconRes(R.mipmap.icon_ledger_emergency);
        label3.setLedgerOptionCodeEnum(ApplicationInfo.LedgerOptionCodeEnum.EMERGENCY);

        LedgerPanelButton label4 = new LedgerPanelButton();
        label4.setTitleRes(R.string.ledger_item_4);
        label4.setIconRes(R.mipmap.icon_ledger_maintenace);
        label4.setLedgerOptionCodeEnum(ApplicationInfo.LedgerOptionCodeEnum.MAINTENANCE);

        LedgerPanelButton label5 = new LedgerPanelButton();
        label5.setTitleRes(R.string.ledger_item_5);
        label5.setIconRes(R.mipmap.icon_ledger_property);
        label5.setLedgerOptionCodeEnum(ApplicationInfo.LedgerOptionCodeEnum.PROPERTY);

        LedgerPanelButton label6 = new LedgerPanelButton();
        label6.setTitleRes(R.string.ledger_item_6);
        label6.setIconRes(R.mipmap.icon_ledger_safe_setting);
        label6.setLedgerOptionCodeEnum(ApplicationInfo.LedgerOptionCodeEnum.SAFE_SETTING);

        List<LedgerPanelButton> items = new ArrayList<>();
        items.add(label1);
        //items.add(label2);
        //items.add(label3);
        //items.add(label4);
        //items.add(label5);
        //items.add(label6);

        return items;

    }
    //add by Andew.yin 2017/8/14 end


    public static List<FunctionVo> getFunctionList() {

        List<FunctionVo> functionVos = new ArrayList<>();

        // 基本信息
        FunctionVo normal = new FunctionVo(R.string.record_normal_name, R.mipmap.icon_record_normal,
                "", ApplicationInfo.RecordFunctionEnum.WEB_NORMAL_INFO_TYPE);
        // 检查点位
        FunctionVo patrol = new FunctionVo(R.string.record_patrol_name, R.mipmap.icon_record_patrol,
                "", ApplicationInfo.RecordFunctionEnum.LOACL_PATROL_TYPE);
        // 隐患记录
        FunctionVo hidden = new FunctionVo(R.string.record_hidden_name, R.mipmap.icon_record_hidden,
                "", ApplicationInfo.RecordFunctionEnum.LOACL_HIDDEN_TYPE);
        // 企业人员
        FunctionVo person = new FunctionVo(R.string.record_person_name, R.mipmap.icon_record_person,
                "", ApplicationInfo.RecordFunctionEnum.WEB_PERSON_TYPE);
        // 重大危险源
        FunctionVo majorHazard = new FunctionVo(R.string.record_major_hazard_name, R.mipmap.icon_record_major_hazard,
                "", ApplicationInfo.RecordFunctionEnum.WEB_MAJOR_HAZARD_TYPE);
        // 特种设备
        FunctionVo specialEquipment = new FunctionVo(R.string.record_special_equipment_name, R.mipmap.icon_record_special_equipment,
                "", ApplicationInfo.RecordFunctionEnum.WEB_SPECIAL_EQUIPMENT_TYPE);
        // 物料信息
        FunctionVo materials = new FunctionVo(R.string.record_materials_name, R.mipmap.icon_record_materials,
                "", ApplicationInfo.RecordFunctionEnum.WEB_MATERIALS_INFO_TYPE);
        // 储罐信息
        FunctionVo tanks = new FunctionVo(R.string.record_tanks_name, R.mipmap.icon_record_tanks,
                "", ApplicationInfo.RecordFunctionEnum.WEB_TANKS_INFO_TYPE);
        // 粉尘信息
        FunctionVo dust = new FunctionVo(R.string.record_dust_name, R.mipmap.icon_record_dust,
                "", ApplicationInfo.RecordFunctionEnum.WEB_DUST_INFO_TYPE);
        // 受限空间
        FunctionVo confineSpace = new FunctionVo(R.string.record_confined_space_name, R.mipmap.icon_record_confine_space,
                "", ApplicationInfo.RecordFunctionEnum.WEB_CONFINED_SPACE_TYPE);
        // 配电箱信息
        FunctionVo electrical = new FunctionVo(R.string.record_electrical_info, R.mipmap.icon_real_electrical,
                "", ApplicationInfo.RecordFunctionEnum.LOCAL_ELECTRICAL_TYPE);
        // 可燃气体
        FunctionVo airInfo = new FunctionVo(R.string.record_air_info, R.mipmap.icon_real_air,
                "", ApplicationInfo.RecordFunctionEnum.LOCAL_AIR_TYPE);
        // 高危工艺
        FunctionVo highDangerInfo = new FunctionVo(R.string.record_high_danger_info, R.mipmap.icon_record_high_danger,
                "", ApplicationInfo.RecordFunctionEnum.LOCAL_HIGH_DANGER_TYPE);
        // 冶金信息
        FunctionVo metallurgyInfo = new FunctionVo(R.string.record_metallurgy, R.mipmap.record_metallurgy,
                "", ApplicationInfo.RecordFunctionEnum.LOCAL_METALLURGY_TYPE);
        // 液氨信息
        FunctionVo ammoniaInfo = new FunctionVo(R.string.record_ammonia_info, R.mipmap.record_ammonia,
                "", ApplicationInfo.RecordFunctionEnum.LOCAL_AMMONIA_TYPE);
        // 职业病危害因素
        FunctionVo occupationaInfo = new FunctionVo(R.string.record_occupationa_info, R.mipmap.record_occupationa,
                "", ApplicationInfo.RecordFunctionEnum.LOCAL_OCCUPATIONA_TYPE);
        // 应急物资
        FunctionVo emergencyInfo = new FunctionVo(R.string.record_emergency_info, R.mipmap.record_emergency,
                "", ApplicationInfo.RecordFunctionEnum.LOCAL_EMERGENCY_TYPE);
        // 特种作业操作证人员
        FunctionVo specialTaskInfo = new FunctionVo(R.string.record_special_task_info, R.mipmap.record_special_task,
                "", ApplicationInfo.RecordFunctionEnum.LOCAL_SPECISL_TASK_TYPE);
        // 企业安全培训信息
        FunctionVo safeTrainInfo = new FunctionVo(R.string.record_safe_train_info, R.mipmap.record_safe_train,
                "", ApplicationInfo.RecordFunctionEnum.LOCAL_COMPANY_TRAINING_TYPE);
        // 应急预案
        FunctionVo emergencyPlanInfo = new FunctionVo(R.string.record_emergrncy_plan_info, R.mipmap.record_emer_plan,
                "", ApplicationInfo.RecordFunctionEnum.LOCAL_EMERGENCY_PLAN_TYPE);

        if (CommonBo.Project.CAMPUS.getValue().equals(Constants.VERSION_SUFFIX)) {
            //校园智慧安全服务云
            functionVos.add(patrol);
            functionVos.add(hidden);
            functionVos.add(person);
            functionVos.add(electrical);
        } else {
            functionVos.add(normal);
            functionVos.add(patrol);
            functionVos.add(hidden);
            functionVos.add(person);
            functionVos.add(majorHazard);
            functionVos.add(specialEquipment);
            functionVos.add(materials);
            functionVos.add(tanks);
            functionVos.add(dust);
            functionVos.add(confineSpace);
            functionVos.add(electrical);
            functionVos.add(airInfo);
            functionVos.add(highDangerInfo);
            functionVos.add(metallurgyInfo);
            functionVos.add(ammoniaInfo);
            functionVos.add(occupationaInfo);
            functionVos.add(emergencyInfo);
            functionVos.add(specialTaskInfo);
            functionVos.add(safeTrainInfo);
            functionVos.add(emergencyPlanInfo);  //TODO之后要加的
        }

        return functionVos;
    }
}
